package org.seckill.dto;

import org.seckill.entity.SuccessKilled;
import org.seckill.enums.SeckillStatEnum;

/**
 * Created by ljd on 2021/1/6.
 */
public class SeckillExecution {
    private long skillId;
    private int status;
    private String statusInfo;
    private SuccessKilled successKilled;

    public SeckillExecution(long skillId, SeckillStatEnum seckillStatEnum, SuccessKilled successKilled) {
        this.skillId = skillId;
        this.status = seckillStatEnum.getState();
        this.statusInfo = seckillStatEnum.getStateInfo();
        this.successKilled = successKilled;
    }

    public SeckillExecution(long skillId, SeckillStatEnum seckillStatEnum) {
        this.skillId = skillId;
        this.status = seckillStatEnum.getState();
        this.statusInfo = seckillStatEnum.getStateInfo();
    }

    public long getSkillId() {
        return skillId;
    }

    public void setSkillId(long skillId) {
        this.skillId = skillId;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getStatusInfo() {
        return statusInfo;
    }

    public void setStatusInfo(String statusInfo) {
        this.statusInfo = statusInfo;
    }

    public SuccessKilled getSuccessKilled() {
        return successKilled;
    }

    public void setSuccessKilled(SuccessKilled successKilled) {
        this.successKilled = successKilled;
    }

    @Override
    public String toString() {
        return "SeckillExecution{" +
                "skillId=" + skillId +
                ", status=" + status +
                ", statusInfo='" + statusInfo + '\'' +
                ", successKilled=" + successKilled +
                '}';
    }
}
